<?php


namespace App\Models\MainDB;

use \Illuminate\Database\Eloquent\Model;

class ProductGroupDetail extends Model
{
    protected $table = 'ln_product_group_detail';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable   = [
        'id',                   // 主键id
        'name',                 //商品组名称
        'sort',                 //  排序
        'group_id',             // 商品组id
        'reward_id',            //奖励道具id
        'cost_score',           //兑换所需积分
        'day_limit',            //每天限制次数
        'add_time',
        'type',
        'number',
        'remark'
    ];
    public    $timestamps = false;

    public function reward_data()
    {
        return $this->hasMany('App\Models\MainDB\RewardDetail', 'reward_id', 'reward_id');
    }

    public function reward()
    {
        return $this->hasMany('App\Models\MainDB\Reward', 'id', 'reward_id');
    }

    public function reward_item()
    {
        return $this->hasMany('App\Models\MainDB\RewardItem', 'id', 'reward_id');
    }
}
